<!-- 电子发票 -->
<template>
	<view class="busines-mod">
		<!-- 个人 -->
		<view class="busines-mod-head" v-if="detailsData.nsbz == '0'">
			<view> <text>纳税标志：</text> <text>{{detailsData.nsbz}}</text> </view>
			<view> <text>户号：</text> <text>{{detailsData.yhbh}}</text> </view>
			<view> <text>户名：：</text> <text>{{detailsData.yhmc}}</text> </view>
			<view> <text>发票抬头：</text> <text>{{detailsData.nsrmc}}</text> </view>
			<view> <text>证件编号：</text> <text>{{detailsData.nsrsbh}}</text> </view>
			<view> <text>电子邮箱：</text> <text>{{detailsData.email}}</text> </view>
		</view>
		<!-- 企业 -->
		<view class="busines-mod-head" v-else>
			<view> <text>纳税标志：</text> <text>{{detailsData.nsbz}}</text> </view>
			<view> <text>户号：</text> <text>{{detailsData.yhbh}}</text> </view>
			<view> <text>户名：：</text> <text>{{detailsData.nsrmc}}</text> </view>
			<view> <text>发票抬头：</text> <text>{{detailsData.nsrmc}}</text> </view>
			<view> <text>纳税识别号：</text> <text>{{detailsData.nsrsbh}}</text> </view>
			<view> <text>联系电话：</text> <text>{{detailsData.nsrdh}}</text> </view>
		</view>
	</view>
</template>

<script setup lang="ts">
	import { YhNsxxSelectiveGetOne } from "@/api/request/YhNsxxSelectiveGetOne";
	import {ref, onBeforeMount, watch } from 'vue';
	const props = defineProps({
		yhbh: {
			type: String,
			default: ""
		}
	})
	let detailsData = ref({});
	onBeforeMount(() => {
		getDetailsData()
	})
	watch(() => props.yhbh, (newValue)=>{
		getDetailsData()
	})
	function getDetailsData () {
		if(props.yhbh){
			YhNsxxSelectiveGetOne({
				data: {
					yhbh: props.yhbh
				},
				success: (res) => {
					detailsData.value = res
				},
				fail: (code, message) => {
					console.log(code, message)
				}
			})
		}
		
	}
	
</script>

<style lang="scss" scoped>
</style>